﻿#ifndef METAVO_H
#define METAVO_H
#include "qbaseentity.h"
/**
 * @brief 菜单/路由 元信息
 */
class MetaVO : public QBaseEntity
{
    Q_OBJECT
    // 使用 Q_PROPERTY 宏定义属性
    Q_PROPERTY(QString activeIcon READ getActiveIcon WRITE setActiveIcon)
    Q_PROPERTY(QString activePath READ getActivePath WRITE setActivePath)
    Q_PROPERTY(bool affixTab READ getAffixTab WRITE setAffixTab)
    Q_PROPERTY(int32_t affixTabOrder READ getAffixTabOrder WRITE setAffixTabOrder)
    Q_PROPERTY(QStringList authority READ getAuthority WRITE setAuthority)
    Q_PROPERTY(QString badge READ getBadge WRITE setBadge)
    Q_PROPERTY(QString badgeType READ getBadgeType WRITE setBadgeType)
    Q_PROPERTY(QString badgeVariants READ getBadgeVariants WRITE setBadgeVariants)
    Q_PROPERTY(bool hideChildrenInMenu READ getHideChildrenInMenu WRITE setHideChildrenInMenu)
    Q_PROPERTY(bool hideInBreadcrumb READ getHideInBreadcrumb WRITE setHideInBreadcrumb)
    Q_PROPERTY(bool hideInMenu READ getHideInMenu WRITE setHideInMenu)
    Q_PROPERTY(bool hideInTab READ getHideInTab WRITE setHideInTab)
    Q_PROPERTY(QString icon READ getIcon WRITE setIcon)
    Q_PROPERTY(QString iframeSrc READ getIframeSrc WRITE setIframeSrc)
    Q_PROPERTY(bool ignoreAccess READ getIgnoreAccess WRITE setIgnoreAccess)
    Q_PROPERTY(bool keepAlive READ getKeepAlive WRITE setKeepAlive)
    Q_PROPERTY(QString link READ getLink WRITE setLink)
    Q_PROPERTY(bool loaded READ getLoaded WRITE setLoaded)
    Q_PROPERTY(int32_t maxNumOfOpenTab READ getMaxNumOfOpenTab WRITE setMaxNumOfOpenTab)
    Q_PROPERTY(bool menuVisibleWithForbidden READ getMenuVisibleWithForbidden WRITE setMenuVisibleWithForbidden)
    Q_PROPERTY(bool openInNewWindow READ getOpenInNewWindow WRITE setOpenInNewWindow)
    Q_PROPERTY(int32_t order READ getOrder WRITE setOrder)
    Q_PROPERTY(QString query READ getQuery WRITE setQuery)
    Q_PROPERTY(QString title READ getTitle WRITE setTitle)
public:
    MetaVO(QObject *parent = nullptr);
    MetaVO(const MetaVO &other);
    MetaVO &operator=(const MetaVO &other);
    ~MetaVO();

    QString getActiveIcon() const;
    void setActiveIcon(const QString &value);

    QString getActivePath() const;
    void setActivePath(const QString &value);

    bool getAffixTab() const;
    void setAffixTab(bool value);

    int32_t getAffixTabOrder() const;
    void setAffixTabOrder(const int32_t &value);

    QStringList getAuthority() const;
    void setAuthority(const QStringList &value);

    QString getBadge() const;
    void setBadge(const QString &value);

    QString getBadgeType() const;
    void setBadgeType(const QString &value);

    QString getBadgeVariants() const;
    void setBadgeVariants(const QString &value);

    bool getHideChildrenInMenu() const;
    void setHideChildrenInMenu(bool value);

    bool getHideInBreadcrumb() const;
    void setHideInBreadcrumb(bool value);

    bool getHideInMenu() const;
    void setHideInMenu(bool value);

    bool getHideInTab() const;
    void setHideInTab(bool value);

    QString getIcon() const;
    void setIcon(const QString &value);

    QString getIframeSrc() const;
    void setIframeSrc(const QString &value);

    bool getIgnoreAccess() const;
    void setIgnoreAccess(bool value);

    bool getKeepAlive() const;
    void setKeepAlive(bool value);

    QString getLink() const;
    void setLink(const QString &value);

    bool getLoaded() const;
    void setLoaded(bool value);

    int32_t getMaxNumOfOpenTab() const;
    void setMaxNumOfOpenTab(const int32_t &value);

    bool getMenuVisibleWithForbidden() const;
    void setMenuVisibleWithForbidden(bool value);

    bool getOpenInNewWindow() const;
    void setOpenInNewWindow(bool value);

    int32_t getOrder() const;
    void setOrder(const int32_t &value);

    QString getQuery() const;
    void setQuery(const QString &value);

    QString getTitle() const;
    void setTitle(const QString &value);

private:
    QString activeIcon;/**<  激活图标（菜单/tab） */
    QString activePath;/**<  当前激活的菜单，有时候不想激活现有菜单，需要激活父级菜单时使用 */
    bool affixTab;/**< 是否固定标签页 */
    int32_t affixTabOrder;/**< 固定标签顺序 */
    QStringList authority;/**< 菜单权限 需要特定的角色标识才可以访问 */
    QString badge;/**< 徽标 */
    QString badgeType;/**< 徽标类型 */
    QString badgeVariants;/**< 徽标颜色 */
    bool hideChildrenInMenu;/**< 当前路由的子级在菜单中不展现 (隐藏子集菜单) */
    bool hideInBreadcrumb;/**< 当前路由在面包屑中不展现 */
    bool hideInMenu;/**< 当前路由在菜单中不展现 */
    bool hideInTab;/**< 当前路由在标签页不展现 */
    QString icon;/**< 图标（菜单/tab） */
    QString iframeSrc;/**< iframe 地址 */
    bool ignoreAccess;/**< 忽略权限可以直接访问 */
    bool keepAlive;/**< 开启KeepAlive缓存 */
    QString link;/**< 外链-跳转路径 */
    bool loaded;/**< 路由是否已经加载过 */
    int32_t maxNumOfOpenTab;/**< 标签页最大打开数量 */
    bool menuVisibleWithForbidden;/**< 重定向到403 */
    bool openInNewWindow;/**< 在新窗口打开 */
    int32_t order;/**< 用于路由->菜单排序 */
    QString query;/**< 菜单所携带的参数 */
    QString title;/**< 标题名称 */
};
Q_DECLARE_METATYPE(MetaVO) //注册到元数据对象
#endif // METAVO_H
